<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="../common.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Project Infor</title>
	<link href="${ctx}/resources/css/project/project.css" rel="stylesheet">
	<link href="${ctx}/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link href="${ctx}/resources/css/bootstrap/bootstrap.min.css" rel="stylesheet">
	<script type="text/javascript" src="${ctx}/resources/js/highcharts/jquery-1.8.2.min.js"></script>
	<c:set var="active" value="variables"/>

</head>
<body>
	<div class="container">
		<div class="row">

		<div class="col-md-10">
			<div class="bs-callout help-callout">
				<p>				${server.serverName}配置.				</p>
			</div>
			<form accept-charset="UTF-8" action="${ctx}/server/save" class="form-horizontal" id="edit" method="post">
				<div style="display:none">
				<input name="id" type="hidden" value="${server.id}">
				</div>
				<fieldset>
				<div class="form-group">
					<label class="control-label" for="serverName">服务器名称</label>
					<div class="col-sm-10">
						<input class="form-control" id="serverName" name="serverName" required type="text" value="${server.serverName}">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="ip">IP</label>
					<div class="col-sm-10">
						<input class="form-control" id="ip" name="ip" required type="text" value="${server.ip}">
						<div class="light">案例：192.168.1.168</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="port">Port</label>
					<div class="col-sm-10">
						<input class="form-control" id="port" name="port" type="text" value="${server.port}">
						<div class="light">服务器SSH端口,案例：22</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="userName">UserName</label>
					<div class="col-sm-10">
						<input class="form-control" id="userName" name="userName" required type="text" value="${server.userName}">
						<div class="light">案例：root</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="passWord">PassWord</label>
					<div class="col-sm-10">
						<input class="form-control" id="passWord" name="passWord" required type="password" value="${server.passWord}">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="type">类型</label>
					<div class="col-sm-10">
						<select class="form-control" id="type" name="type">
						 	<option value="0">本地</option>
							<option value="1">远程</option>
					     </select>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="type">状态</label>
					<div class="col-sm-10">
						<select class="form-control" id="status" name="status">
						 	<option value="0">启用</option>
							<option value="1">停用</option>
					     </select>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="description">描述</label>
					<div class="col-sm-10">
						<textarea class="form-control" id="description" name="description" rows="7">${server.description}</textarea>
						<div class="light">服务器说明</div>
					</div>
				</div>
				</fieldset>
			
				<div class="form-actions">
					<input class="btn btn-save" name="commit" type="submit" value="Save changes">
					<a class="btn pull-right" href="${ctx}/server/list">Cancel</a>
				</div>
			</form>
		</div>
</div>
</div>
<script language="javascript">
	setStatus(${server.status});
	setType(${server.type});
	
	function setStatus(status){
		$("#status").find("option[value='"+status+"']").attr("selected",true);
	}
	
	function setType(type){
		$("#type").find("option[value='"+type+"']").attr("selected",true);
	}
</script>
</body>
</html>
